# add the class of each agent as factor (class) and as numeric (classF)
data_with_class <- function(data=antidep){
data$class <-as.factor(with(data, ifelse(
drug=='desvenlafaxine' | drug=='venlafaxine' | drug=='duloxetine' | drug=='milnacipran' | drug=='levomilnacipran', 'SNRI', ifelse(
drug=='bupropion' , 'NDRI', ifelse(
drug=='mirtazapine', 'NaSSA', ifelse(
drug=='trazodone'|drug=='nefazodone', 'SARI', ifelse(
drug=='reboxetine', 'NRI',ifelse(
drug=='placebo', 'placebo',ifelse(
drug=='citalopram' | drug=='fluvoxamine' | drug=='escitalopram' | drug=='paroxetine' | drug=='sertraline' | drug=='fluoxetine'| drug=='vilazodone', 'SSRI',ifelse(
drug=='amitriptyline'| drug=='clomipramine', 'TCA',ifelse(
drug=='agomelatine', 'agomelatine', 'vortioxetine'
)
)
)))))))))
data$classF <- as.numeric(data$class)
return(data)
}
#
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.